<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            position: absolute;
            right: 0;
            top: 50%;
            margin-top: -50px;
            margin-right: 50px;
            display: block;
            width: 120px;
            height: 150px;
            background-color: #fff;
            border: 1px solid rgba(104, 40, 0, 0.3);
            box-shadow: 0px 0px 10px rgba(104, 40, 0, 0.3)
        }
        
        .box p {
            font-size: 12px;
            text-align: center;
            color: rgb(104, 40, 0);
        }
        
        .box .wrong {
            float: right;
            width: 15px;
            height: 15px;
            position: relative;
            /* top: -15px; */
        }
        
        .wechat {
            width: 100px;
            height: 100px;
            margin-left: 10px;
        }
    </style>
</head>

<body>
    <div class="box">
        <img src="images/叉.png" alt="" class="wrong">
        <p>扫码添加微信</p>
        <img src="images/wechat.jpg" alt="" class="wechat">
        <script>
            // 1.获取元素
            var wrong = document.querySelector('.wrong');
            var box = document.querySelector('.box');
            // 2.绑定事件
            wrong.onclick = function() {
                box.style.display = 'none';
            }
        </script>
    </div>
</body>

</html>